Skip to content

Fix crashes on nullptr#4575

Merged
danmar merged 13 commits intocppcheck-opensource:mainfrom
chrchr-github:chrchr-github-patch-1
Nov 9, 2022
Merged

Fix crashes on nullptr#4575
danmar merged 13 commits intocppcheck-opensource:mainfrom
chrchr-github:chrchr-github-patch-1

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread test/testtokenize.cpp Outdated
}

void noCrash7() {
ASSERT_NO_THROW(tokenizeAndStringify("enum : { };\n"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like garbage code. I suggest we move it to testgarbage. what do you think about throwing a syntax error for the code enum : {?

Comment thread test/testtokenize.cpp Outdated

void noCrash7() {
ASSERT_NO_THROW(tokenizeAndStringify("enum : { };\n"
"enum : 3 { };\n"));
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the feeling that enum:3 is syntax error also.

@chrchr-github chrchr-github changed the title Fix crash on nullptr Fix crashes on nullptr Nov 8, 2022
@danmar danmar merged commit ffc0c57 into cppcheck-opensource:main Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants